package com.chen.apipassenger.remote;

import com.chen.internalcommon.dto.ResponseResult;
import com.chen.internalcommon.dto.UserInfo;
import com.chen.internalcommon.request.LoginOrRegisterRequest;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;

/**
 * @author chenLiuPing
 **/
@FeignClient("service-passenger-user")
public interface ServicePassengerUserClient {

    /**
     * 根据手机号登录或者注册用户
     * @param loginOrRegisterRequest
     * @return
     */
    @PostMapping("/user")
    ResponseResult loginOrRegister(@RequestBody LoginOrRegisterRequest loginOrRegisterRequest);

    @GetMapping("/user{phone}")
    ResponseResult<UserInfo> getUser(@PathVariable("phone") String passengerPhone);
}
